home *** CD-ROM | disk | FTP | other *** search
Text File | 1995-11-08 | 3.6 KB | 140 lines | [TEXT/MPS ] |
- //========================================================================================
- //
- // File: FWCPat.h
- // Release Version: $ 1.0d11 $
- //
- // Copyright: © 1993, 1995 by Apple Computer, Inc., all rights reserved.
- //
- //========================================================================================
-
- #ifndef FWCPAT_H
- #define FWCPAT_H
-
- #ifndef FWPAT_H
- #include "FWPat.h"
- #endif
-
- // ----- Foundation Includes -----
-
- #ifndef FWSTDDEF_H
- #include <FWStdDef.h>
- #endif
-
- #ifndef FWPRIMEM_H
- #include <FWPriMem.h>
- #endif
-
- // ----- Macintosh Includes -----
-
- #if defined(FW_BUILD_MAC) && !defined(__QUICKDRAW__)
- #include <QuickDraw.h>
- #endif
-
- // ----- Windows Includes -----
-
- #if defined(FW_BUILD_WIN) && !defined(_INC_WINDOWS)
- #include <windows.h>
- #endif
-
- #if FW_LIB_EXPORT_PRAGMAS
- #pragma lib_export on
- #endif
-
- //========================================================================================
- // Forward Class Declarations
- //========================================================================================
-
- class FW_CLASS_ATTR FW_CReadableStream;
- class FW_CLASS_ATTR FW_CWritableStream;
- class FW_CLASS_ATTR FW_CColor;
-
- //========================================================================================
- // CLASS FW_CColorPatternRep
- //========================================================================================
-
- class FW_CLASS_ATTR FW_CColorPatternRep : public FW_CPatternRep
- {
- friend class FW_CLASS_ATTR FW_PPattern;
-
- public:
- FW_DECLARE_CLASS
-
- //----------------------------------------------------------------------------------------
- // Constructors/Destructors
- //
- protected:
- FW_CColorPatternRep();
- FW_CColorPatternRep(const FW_PixelPattern& pixels, short nbColors, const FW_CColor* colorTable);
-
- FW_CColorPatternRep(FW_PlatformColorPattern platformColorPattern);
-
- FW_CColorPatternRep(FW_CReadableStream& archive);
-
- virtual ~FW_CColorPatternRep();
-
- //----------------------------------------------------------------------------------------
- // Inherited API
- //
- public:
- virtual FW_Boolean IsEqual(const FW_CGraphicCountedPtrRep* other) const;
- virtual void Flatten(FW_CWritableStream& archive) const;
-
- virtual FW_PPattern Copy() const;
-
- virtual FW_Boolean IsBlack() const;
-
- virtual void Invert();
-
- virtual void FlipHorizontaly();
- virtual void FlipVerticaly();
-
- virtual void ShiftUp();
- virtual void ShiftDown();
- virtual void ShiftLeft();
- virtual void ShiftRight();
-
- static void* Read(FW_CReadableStream& archive);
-
- private:
- void MakePixelPattern(const FW_PixelPattern& pixels, short nbColors, const FW_CColor* colorTable);
-
- void GetPixelData(FW_PixelPattern& pixData) const;
- void SetPixelData(const FW_PixelPattern& pixData);
-
- unsigned short GetColorTable(FW_CColor*& colors) const;
-
- //----------------------------------------------------------------------------------------
- // Platform Specific
- //
- public:
- #ifdef FW_BUILD_WIN
- virtual HBRUSH WinCreatePatternBrush() const;
-
- static void WinFlipPixelCopy(const void* source, void* dest);
- #endif
-
- #ifdef FW_BUILD_MAC
- virtual void MacSetInCurPort() const;
- static PixPatHandle MacNewPixPat(const void* pixels, short rowbytes, short pixelSize,
- short withPower, short heightPower,
- short nbColors, const FW_CColor* colorTable);
- #endif
-
- //----------------------------------------------------------------------------------------
- // Data Member
- //
- private:
- FW_PlatformColorPattern fPlatformColorPattern;
-
- #ifdef FW_BUILD_WIN
- HBITMAP fWinCachedBitmap;
- void WinForgetCachedBitmap();
- #endif
- };
-
- #if FW_LIB_EXPORT_PRAGMAS
- #pragma lib_export off
- #endif
-
- #endif
-